<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>申请贷款</title>
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="/css/core.css" type="text/css">
<script type="text/javascript" src="/js/jquery-1.12.4.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/jquery.bootstrap.min.js"></script>

<script type="text/javascript" src="/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="/js/plugins/jquery-validation/jquery.validate.js"></script>
<style type="text/css">
    body {
        font: 14px/1.5 "Verdana", "微软雅黑", YaHei, tahoma, arial, Hiragino Sans GB, "宋体";
    }

    .el-borrow-form {
        position: relative;
    }

    .el-borrow-form-tip {
        width: 300px;
        border-radius: 3px;
        border: 1px solid #ddd;
        box-shadow: 1px 1px 20px #ddd;
        padding: 20px 30px;
        position: absolute;
        top: 10px;
        right: 100px;
    }

    .text-danger {
        text-align: center;
    }
</style>
<script type="text/javascript">
    $(function () {
        $("#editForm").validate({
            rules: {
                bidRequestAmount: {
                    required: true,
                    number: true,
                    min: 500,
                    max: 5000
                },
                currentRate: {
                    required: true,
                    number: true,
                    min: 5,
                    max: 20
                },
                minBidAmount: {
                    required: true,
                    number: true,
                    min: 50
                },
                title: "required"
            },
            messages: {
                bidRequestAmount: {
                    required: "请填写借款金额",
                    number: "借款金额为数字",
                    min: "借款金额最小为{0}",
                    max: "借款金额最大为{0}"
                },
                currentRate: {
                    required: "请填写借款利息",
                    number: "借款利息为数字",
                    min: "最低借款利息为{0}%",
                    max: "最大借款利息不能超过{0}%"
                },
                minBidAmount: {
                    required: "请填写最小投标金额",
                    number: "最小投标金额为数字",
                    min: "最小投标金额必须大于{0}"
                },
                title: "必须填写借款原因"
            },
            //自定义错误样式
            errorClass: "text-danger col-sm-6",
            //未通过验证,进行高亮处理或其他处理；
            highlight: function (input) {
                $(input).closest(".form-group").addClass("has-error");
            },
            //通过验证,清除高亮效果或其他处理；
            unhighlight: function (input) {
                $(input).closest(".form-group").removeClass("has-error");
            },
            //错误提示信息加载的位置
            errorPlacement: function (label, element) {
                label.appendTo(element.closest(".form-group"));
            }
        });
    });
</script>
</head>
<body>


<script type="text/javascript">
    $("#" + "borrow").addClass("active");

    $(function () {
        $("#yy").hide();
        $("#cc").click(function () {
            <c:if test="${ok==false}">
                $("#yy").show();
                $("#xx").hide();
                return false;
            </c:if>
        });
    })
</script>

<div class="container">

        <div class="el-tip-info" id="yy" >
            <h3>借款提示</h3>
            <p>
                <span class="text-info">你目前有标正在申请流程当中，不能再次发标；或者你恶意的进入了发标流程，请按正常流程完成发标前的相关资料提交，谢谢</span>
            </p>
        </div>


        <div class="el-tip-info" id="xx">
            <h3>信用借款</h3>
            <p>
                <span class="text-info">可借金额：</span><span class="text-danger">5,000</span>
            </p>
        </div>

        <div class="page-header lead">
            借款信息
            <label class="label label-primary">信用标</label>
        </div>
        <form class="form-horizontal el-borrow-form" id="editForm" novalidate="novalidate" method="post"
              action="/insertBorrow">
            <c:forEach items="${userFiles}" var="userFile">
                <input type="hidden" name="id" value="${userFile.id}" />
            </c:forEach>

            <div class="form-group">
                <label class="col-sm-3 control-label">
                    借款金额
                </label>
                <div class="col-sm-3  input-group">
                    <input class="form-control" name="bidRequestAmount" id="bidRequestAmount">
                    <span class="input-group-addon">元</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    借款利息
                </label>
                <div class="col-sm-3  input-group">
                    <input class="form-control" name="currentRate">
                    <span class="input-group-addon">%</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    借款期限
                </label>
                <div class="col-sm-3 input-group">
                    <select class="form-control" name="monthes2Return">
                        <option value="1">1</option>
                        <option value="3">3</option>
                        <option value="6">6</option>
                        <option value="9">9</option>
                        <option value="12">12</option>
                    </select>
                    <span class="input-group-addon">月</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">
                    还款方式
                </label>
                <label class="radio-inline">
                    <input type="radio" value="0" checked="checked" name="returnType">
                    按月分期
                </label>
                <label class="radio-inline">
                    <input type="radio" value="1" name="returnType">
                    按月到期
                </label>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    最小投标
                </label>
                <div class="col-sm-3  input-group">
                    <input class="form-control" name="minBidAmount">
                    <span class="input-group-addon">元</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    招标天数
                </label>
                <div class="col-sm-3 input-group">
                    <select class="form-control" name="disableDays">
                        <option value="1">1</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                        <option value="4">4</option>
                        <option value="5">5</option>
                    </select>
                    <span class="input-group-addon">天</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    借款标题
                </label>
                <div class="col-sm-6 input-group">
                    <input name="title" class="form-control">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    借款描述
                </label>
                <div class="col-sm-6  input-group">
                    <textarea name="description" rows="4" class="form-control" style="resize: none;"></textarea>
                </div>
            </div>
            <div class="form-group">
                <button class="btn btn-primary col-lg-offset-3" id="cc" type="submit" data-loading-text="提交">
                    提交申请
                </button>
            </div>

            <div class="el-borrow-form-tip">
                <h4>相关费用</h4>
                <p>
                    <span class="text-info">利息</span>
                    <span class="el-borrow-cost" id="cost01">--</span>
                </p>
                <p>
                    <span class="text-info">奖金</span>
                    <span class="el-borrow-cost" id="cost02">--</span>
                </p>
                <p>
                    <span class="text-info">管理费</span>
                    <span class="el-borrow-cost" id="cost03">--</span>
                </p>
            </div>
        </form>

</div>

<div class="container-foot-2">
    <div class="context">
        <div class="left">
            <p>版权所有： 广州xxx科技有限公司</p>
            <p>地  址： 广州市天河区棠下荷光三横路盛达商务园D座5楼</p>
            <p>电  话： 020-29007520  
                邮箱： service@520it.com</p>
            <p>
                <a href="http://www.miitbeian.gov.cn" style="color: #ffffff">ICP备案
                    ：粤ICP备字1504547</a>
            </p>
            <p>
                <a href="http://www.gzjd.gov.cn/wlaqjc/open/validateSite.do"
                   style="color: #ffffff">穗公网安备：44010650010086</a>
            </p>
        </div>
        <div class="right">
            <a target="_blank" href="http://weibo.com/ITxiaomage"><img src="/images/sina.png"></a>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
</body>
</html>
